<!--
 * @Description: 
 * @Author: charles
 * @Date: 2021-06-17 18:05:45
 * @LastEditors: charles
 * @LastEditTime: 2021-06-17 18:11:55
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>复习</title>
</head>
<body>
  <script>
    // 1. 变量
    var a = 1;        // 变量，允许重复声明
    let b = true;     // 变量
    const c = "hello world" ;  // 常量
    // 2. 弱类型 奇葩特性
    let d = "hello world";  // String类型
    d = true; // d为Boolean类型
    d = 1;    // d为Number类型
    b + d;
    // 3. 基本数据类型 3种
    // 4. 引用数据类型
    let obj1 = {
      name:"terry",
      age:1,
      gender:"male"
    }
    let id = 1;
    let obj2 = {id};    //等价于 { id : 1}
    // 5. 数组
    var arr1 = ["terry","larry","tom"];
    var arr2 = [{
        name:"terry",
        age:1,
        gender:"male"
      },{
        name:"larry",
        age:2,
        gender:"female"
      },{
        name:"tom",
        age:2,
        gender:"male"
      }]
  </script>
</body>
</html>